/**
 *  Copyright 2011 Pavlov Dm.
 *  Licensed under the MIT License
 */
 
package org.motiv.tests.policy;

import org.junit.Test;
import static org.junit.Assert.*;

import org.motiv.policy.LfuPolicy;
import org.motiv.core.Element;

/**
 * A cache lfu policy tests.
 * @author Pavlov Dm
 */

 public class LfuPolicyTest{
	@Test
	public void check_compareElemens_method() {
		final Element element_hit_0 = ElementFactory.create(1L,"first");
		final Element element_hit_1 = ElementFactory.create(2L,"second");
		element_hit_1.updateAccessStatistics(); 
		assertTrue("check the second element is preferable to the first element",new LfuPolicy().compare(element_hit_1,element_hit_0));
		assertTrue("check the second element is preferable to the first element",!new LfuPolicy().compare(element_hit_0,element_hit_1));
	}
}